using MicroMsg.Common.Utils;
using MicroMsg.Manager;
using MicroMsg.Protocol;
using MicroMsg.Resource.@string;
using MicroMsg.UI.Page;
using MicroMsg.UI.UserContrl;
using MicroMsg.UI.Util;
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Media.Imaging;
namespace MicroMsg.Plugin.ViewQQInfo
{
	public class ViewQQInfo : PluginBase
	{
		private const string TAG = "ViewQQInfo";
		public const string PluginKey = "plugin ViewQQInfo";
		public const long PluginID = 32774L;
		public const string PluginName = "ViewQQInfo";
		public const int PluginVersion = 256;
		private static ViewQQInfo mInstance;
		public override string mTitle
		{
			get
			{
				return strings.Plugin_ViewQQInfo_NickName;
			}
		}
		public override string mFFEntryTitle
		{
			get
			{
				return strings.FF_Entry_QQFriend;
			}
		}
		public override BitmapSource mIcon
		{
			get
			{
				if (MMTheme.IsCoolBlackTheme())
				{
					return ImageCacheMgr.loadFromRes("Source/Plugin/ViewQQInfo/Resource/Img/plugin_setting_cool.png");
				}
				return ImageCacheMgr.loadFromRes("Source/Plugin/ViewQQInfo/Resource/Img/plugin_setting_normal.png");
			}
		}
		public override BitmapSource mIconHD
		{
			get
			{
				return ImageCacheMgr.loadFromRes("Source/Plugin/ViewQQInfo/Resource/Img/plugin_setting_HD.png");
			}
		}
		public override BitmapSource mIconInList
		{
			get
			{
				return this.mIcon;
			}
		}
		public override string mDescription
		{
			get
			{
				return strings.Plugin_ViewQQInfo_Info;
			}
		}
		public override string mAuthor
		{
			get
			{
				return "tencent";
			}
		}
		public ViewQQInfo()
		{
			this.mKey = "plugin ViewQQInfo";
			this.mID = 32774L;
			this.mName = "ViewQQInfo";
			this.mVersion = 256;
			this.mIndexInTab = MainTabIndex.AddFriendList;
			this.mIndexInGroup = 0;
			this.mIndexInPosition = 1;
			this.mDefaultInstalled = true;
			this.mEnabled = true;
			if (AccountMgr.getCurAccount().nBindQQ <= 0u)
			{
				RegionInfo currentRegion = RegionInfo.get_CurrentRegion();
				if (currentRegion.get_Name() != "CN")
				{
					this.mEnabled = true;
					this.mDefaultInstalled = false;
				}
			}
			ViewQQInfo.mInstance = this;
			base.mIconInFFEntry = ImageCacheMgr.loadFromRes(MMTheme.GetInstance().qqFriend_main);
		}
		public override PluginSettingBaseCtrl GetPluginSettingCtrl()
		{
			return new SimplePluginSetCtrl(strings.Plugin_ViewQQInfo_NickName, new RoutedEventHandler(this.onBtnClickViewQQInfo));
		}
		private void onBtnClickViewQQInfo(object sender, RoutedEventArgs e)
		{
			this.execute(4, null);
		}
		public static ViewQQInfo getInstance()
		{
			return ViewQQInfo.mInstance;
		}
		public override void onRegisterResult(RetConst retConst_0, int code)
		{
			Log.smethod_4("ViewQQInfo", string.Concat(new object[]
			{
				"on register result , ret = ",
				retConst_0,
				", code = ",
				code
			}));
		}
		public override bool onInitialize()
		{
			Log.smethod_4("ViewQQInfo", "initialize. ");
			return true;
		}
		public override bool onInstalled(InstallMode mode)
		{
			Log.smethod_4("ViewQQInfo", "on inistalled. ");
			return true;
		}
		public override bool onUninstalled(InstallMode mode)
		{
			Log.smethod_4("ViewQQInfo", "on uninstalled. ");
			return true;
		}
		public override void onAppActivated()
		{
		}
		public override void onAppDeactivated()
		{
		}
		public override object execute(int entryType, object args)
		{
			Log.smethod_4("ViewQQInfo", "plugin execute,   entrytype =" + entryType);
			if (entryType == 1)
			{
				return null;
			}
			if (entryType == 2)
			{
				return null;
			}
			if (entryType == 3)
			{
				this.entryQQInfoFromFriendTab();
				return null;
			}
			if (entryType == 4)
			{
				this.entryQQInfoFromFriendTab();
				return null;
			}
			return null;
		}
		private void entryQQInfoFromFriendTab()
		{
			if (AccountMgr.getCurAccount().nBindQQ <= 0u)
			{
				ToolFunction.GotoPageForUserControl("/Source/UI/QQFriends/GoBindQQ.xaml", null, false);
				return;
			}
			ToolFunction.GotoPageForUserControl("/Source/Plugin/Common/QQInfo/UI/ViewQQGroups.xaml", null, false);
		}
	}
}
